<?php

Injeen::import("View");

class Main {

	private $view;
	private $selector;

	public function __construct() {
		$this->selector = new Selector();
		$this->view = View::getInstance();
		$this->view->setTemplateFromFile("main");
	}

	public function index() {
		$title = $this->selector->query("title");
		if ($title) {
			$title->setValue("Index");
		}
	}

	public function __destruct() {

		/*
		$main = $this->selector->query("#main");

		$ul = new Node("<ul/>");
		$ul->set("id", "injeen-console");
		$main->append($ul);

		$lines = Log::getLog();
		var_dump($lines);
		foreach ($lines as $line) {
			$li = new Node("<li/>");
			$li->setText($line);
			$ul->append($li);
		}
		//*/

		$this->view->flush();

	}

}